package com.ytktt.study.week1.task1;

/**
 * 一个简单的 Hello.java，里面需要涉及基本类型，四则运行，if 和 for
 *
 * @author ytk
 */
public class Hello {
    public static void main(String[] args) {
        boolean bool = true;
        byte byteNum = 7;
        short shortNum = 14;
        int intNum = 21;
        long longNum = 28L;
        float floatNum = 35.2F;
        double doubleNum = 42.7D;
        char ch = 'a';

        if (bool) {
            for (int i = 0; i < intNum; ++i) {
                int op = i % 5;
                if (op == 0) {
                    System.out.println("floatNum + byteNum: " + (floatNum + byteNum));
                } else if (op == 1) {
                    System.out.println("doubleNum - byteNum: " + (doubleNum - byteNum));
                } else if (op == 2) {
                    System.out.println("shortNum * byteNum: " + (shortNum * byteNum));
                } else if (op == 3) {
                    System.out.println("longNum / byteNum: " + (longNum / byteNum));
                } else {
                    System.out.println("ch test1: " + ch + 1);
                    System.out.println("ch test2: " + (ch + 1));
                }
            }
        }
    }
}
